home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / Developer Documentation / Recipes, Tech Notes & Articles / Tech Notes / Utilities Documentation / InfoUtil < prev    next >
Encoding:
Text File  |  1996-07-24  |  8.6 KB  |  231 lines  |  [TEXT/ttxt]

  1. OpenDoc™ Utilities Documentation
  2.  
  3. Info Utilities
  4. by The OpenDoc Design Team
  5.  
  6. © 1993-1996  Apple Computer, Inc. All Rights Reserved.
  7. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  8. Mac and OpenDoc are trademarks of Apple Computer, Inc.
  9.  
  10.  
  11. Introduction
  12.  
  13. The info utilities get and set common properties of parts and storage units. All Getters expect you to pass in a buffer to be filled or kODNULL which causes it to create one for you. All Setters do NOT consume what you pass in, so it is safe to pass in a reference to your internal structures.  They are only accessed for the duration of the Setter API call. These conventions were adopted to reduce memory allocation/deallocation.
  14.  
  15.  
  16. Info Utilities
  17.  
  18. Storage unit  property getters and setters:
  19.  
  20.  ODULong ODGetCreationDate(Environment* ev, 
  21.                            ODStorageUnit* su);
  22.  
  23. Given a storage unit, gets the creation date property. Return 0 if that does not exist.
  24.  
  25.  void ODSetCreationDate(Environment* ev, 
  26.                         ODStorageUnit* su,
  27.                         ODTime dateTime);
  28.  
  29. Given a storage unit, sets the creation date property.
  30.  
  31.  ODULong ODGetModificationDate(Environment* ev, 
  32.                                ODStorageUnit* su);
  33.  
  34. Given a storage unit, gets the modification date property. Return 0 if that does not exist.
  35.  
  36.  void ODSetCreationDate(Environment* ev, 
  37.                         ODStorageUnit* su,
  38.                         ODTime dateTime);
  39.  
  40. Given a storage unit, sets the modification date property.
  41.  
  42.  ODIText* ODGetModifiedBy(Environment* ev, 
  43.                           ODStorageUnit* su,
  44.                           ODIText* userName);
  45.  
  46. Given a storage unit, gets the name of user who modified it. Return kODNULL if that does not exist.
  47.  
  48.  void ODSetModifiedBy(Environment* ev, 
  49.                       ODStorageUnit* su,
  50.                       ODIText* userName);
  51.  
  52. Given a storage unit, sets the name of user who modified it.
  53.  
  54.  ODStorageUnit* ODGetSUFromPstObj(Environment* ev,
  55.                                   ODPersistentObject* pstobj);
  56.  
  57. Returns the storage unit of the persistent object.
  58.  
  59.  ODIText* ODGetPOComments(Environment* ev,
  60.                           ODPart* part,
  61.                           ODIText* comments);
  62.  
  63. Returns the comment property of the part. Returns kODNULL if there is no such property. DO NOT use on a part.
  64.  
  65.  void ODSetPOComments(Environment* ev,
  66.                       ODPart* part,
  67.                       ODIText* comments);
  68.  
  69. Sets the comment property of the part. DO NOT use on a part.
  70.  
  71.  ODIconFamily ODGetPOIconFamily(Environment* ev,
  72.                                 ODPart* part);
  73.  
  74. Returns the icon family for the part. Returns kODNULL if there is no such property. DO NOT use on a part.
  75.  
  76.  void ODSetPOIconFamily(Environment* ev, 
  77.                         ODPart* part,
  78.                         ODIconFamily iconFamily,
  79.                         ODBoolean deleteOtherPlatformIcons =kODTrue);
  80.  
  81. Sets the icon family for the part. Will delete icon families for all other platforms if deleteOtherPlatformIcons is true.
  82. The default for deleteOtherPlatformIcons is true. DO NOT use on a part.
  83.  
  84. ODULong ODGetPOSize(Environment* ev, 
  85.                      ODPersistentObject* pstobj);
  86.  
  87. Returns the size of the storage unit of the persistent object.
  88.  
  89.  ODID ODGetPOID(Environment* ev, 
  90.                 ODPersistentObject* pstobj);
  91.  
  92. Returns the scripting ID of the persistent object.
  93.  
  94.  ODIText* ODGetPOName(Environment* ev, 
  95.                       ODPersistentObject* pstobj,
  96.                       ODIText* name);
  97.  
  98. Returns the name property of the persistent object. Returns kODNULL if that does not exists. DO NOT use on a part.
  99.  
  100.  void ODSetPOName(Environment* ev, 
  101.                   ODPersistentObject* pstobj,
  102.                   ODIText* name);
  103.  
  104. Sets the name property of the persistent object. DO NOT use on a part.
  105.  
  106.  void ODSetPONameUsingSU(Environment* ev,
  107.                          ODStorageUnit* su,
  108.                          ODIText* name);
  109.  
  110. Sets the name property of the storage unit.
  111.  
  112. Part only property getters and setters:
  113.  
  114.  ODIText* ODGetPartName(Environment* ev, 
  115.                         ODFrame* frame,ODIText* name);
  116.  
  117. Returns the name of the part of the frame passed in.
  118.  
  119.  ODBoolean ODSetPartName(Environment* ev, 
  120.                          ODFrame* frame,
  121.                          ODIText* name,
  122.                          DescType replaceOption);
  123.  
  124. Sets the name of the part of the frame passed in. If the part is a root part, then the window name, docuemnt name may be affected. This may resulted in replacing an existing file of the same name, and so the replaceOption parameter is needed. The boolean  indicated whether the operation is sucessful.
  125.  
  126.  void ODRenamePartWindows(Environment *ev,
  127.                           ODSession *session,
  128.                           ODPart *part,
  129.                           ODIText *oldName,
  130.                           ODIText *name);
  131.  
  132. Renames windows with part as their root part. This call is usually not needed because ODSetPartName would normally do the job for you. 
  133.  
  134.  ODIText* ODGetComments(Environment* ev,
  135.                         ODFrame* frame,
  136.                         ODIText* comments);
  137.  
  138. Returns the comment property of the part of the frame passed in.
  139.  
  140.  void ODSetComments(Environment* ev,
  141.                     ODFrame* frame,
  142.                     ODIText* comments);
  143.  
  144. Sets the comment property of the part of the frame passed in. If the part is a root part, then the finder comment is also affected.
  145.  
  146.  ODName* ODGetCategory(Environment* ev,
  147.                        ODPart* part,
  148.                        ODNameSpaceManager* nsm);
  149.  
  150. Returns the category of preferred kind or the highest fidelity kind of the part.
  151.  
  152.  ODName* ODGetCatFromPartSU(Environment* ev,
  153.                             ODStorageUnit* su,
  154.                             ODNameSpaceManager* nsm);
  155.  
  156. Returns the category of preferred kind or the highest fidelity kind of a storage unit.
  157.  
  158.  ODName* ODGetCatFromKind(Environment* ev,
  159.                           ODType kind,
  160.                           ODNameSpaceManager* nsm);
  161.  
  162. Returns the category of a data kind.
  163.  
  164.  ODType ODGetKind(Environment* ev,
  165.                   ODPart* part);
  166.  
  167. Returns the preferred kind or the highest fidelity kind of the part.
  168.  
  169.  ODType ODGetKindFromPartSU(Environment* ev,
  170.                             ODStorageUnit* su);
  171.  
  172. Returns the preferred kind or the highest fidelity kind of the storage unit.
  173.  
  174.  ODPlatformType ODGetIconFilePlatformTypeFromPartSU(Environment* ev, 
  175.                                                     ODStorageUnit* su);
  176.  
  177. Returns the ODPlatformType for the preferred kind or file type in the storage unit.
  178.  
  179.  ODPlatformType ODGetIconFilePlatformCreator(Environment *ev,
  180.                                              ODPart *part);
  181.  
  182. Returns the part editors platform file creator associated via nmaps with its preferred kind.
  183.  
  184.  ODPlatformType ODGetIconFilePlatformCreatorFromPartSU(Environment *ev,
  185.                                                        ODStorageUnit *su);
  186.  
  187. Binds an editor to the part and returns that editors platform file creator associated via nmaps with its preferred kind.
  188.  
  189.  ODIconFamily ODGetIconFamily(Environment* ev,
  190.                               ODFrame* frame);
  191.  
  192. Returns an ODIconFamily for the frames part or generic icons if an associated ODIconFamily is not found.
  193. THROWS only if it can't get the generic icons.
  194.  
  195. void ODSetIconFamily(Environment* ev, 
  196.                       ODFrame* frame,
  197.                       ODIconFamily iconFamily,
  198.                       ODBoolean deleteOtherPlatformIcons =kODTrue);
  199.  
  200. Sets the icon family for the part. Will delete icon families for all other platforms if deleteOtherPlatformIcons is true.
  201. The default for deleteOtherPlatformIcons is true.
  202.  
  203. ODBoolean ODGetIsStationery(Environment* ev, 
  204.                              ODFrame* frame);
  205.  
  206. If the frame contains the root part, then returns kODTrue if the document is a stationery.
  207.  
  208.  void ODSetIsStationery(Environment* ev, 
  209.                         ODFrame* frame,
  210.                         ODBoolean isStationery);
  211.  
  212. If the frame contains the root part, then sets whether the document is a stationery.
  213.  
  214. General Utility functions:
  215.  
  216.  void SetAllWindowShowLinks(Environment* ev,
  217.                             ODWindowState* winState,
  218.                             ODBoolean showLinks);
  219.  
  220. Set whether all the windows should show links.
  221.  
  222.  PlatformFile*    ODGetFileIfRoot(Environment* ev,
  223.                               ODFrame* frame);
  224.  
  225. If the frame contains the root part, then  returns the platform file.
  226.  
  227.  ODBoolean ODAskUserReplace(Environment* ev,
  228.                             ODSession* session);
  229.  
  230. Puts up a dialog when there is a name conflict to ask whether the existing one should be replaced. The name in question is passed via ParamText(^0).
  231.